package com.daocao.jy.api.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.daocao.jy.api.ResponseModel;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by xsooy-pc on 18-4-24.
 */

public class OilcardListModel extends ResponseModel implements Parcelable {

    public List<DatasBean> datas;

    public static class DatasBean implements Parcelable {
        /**
         * id : 1
         * ctype : 1
         * card_number : 666
         * phone : 13622660671
         * name : 苏轼
         */

        public String id;
        public String ctype;
        public String card_number;
        public String phone;
        public String name;

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.id);
            dest.writeString(this.ctype);
            dest.writeString(this.card_number);
            dest.writeString(this.phone);
            dest.writeString(this.name);
        }

        public DatasBean() {
        }

        protected DatasBean(Parcel in) {
            this.id = in.readString();
            this.ctype = in.readString();
            this.card_number = in.readString();
            this.phone = in.readString();
            this.name = in.readString();
        }

        public static final Creator<DatasBean> CREATOR = new Creator<DatasBean>() {
            @Override
            public DatasBean createFromParcel(Parcel source) {
                return new DatasBean(source);
            }

            @Override
            public DatasBean[] newArray(int size) {
                return new DatasBean[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeList(this.datas);
    }

    public OilcardListModel() {
    }

    protected OilcardListModel(Parcel in) {
        this.datas = new ArrayList<DatasBean>();
        in.readList(this.datas, DatasBean.class.getClassLoader());
    }

    public static final Parcelable.Creator<OilcardListModel> CREATOR = new Parcelable.Creator<OilcardListModel>() {
        @Override
        public OilcardListModel createFromParcel(Parcel source) {
            return new OilcardListModel(source);
        }

        @Override
        public OilcardListModel[] newArray(int size) {
            return new OilcardListModel[size];
        }
    };
}
